@extends('layouts.app')

@section('content')
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><i class="fa fa-fw fa-cog"></i>行政案件</li>
                <li>案件类型</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="btn-toolbar list-toolbar">
                <a href="{{url('admin/case/typeadd')}}" class="btn btn-primary add-user"><i class="fa fa-plus"></i>添加</a>
                <div class="form-all">
                    <table class="table table-form table-striped table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th width="80">序号</th>
                            <th>类型名称</th>
                              <th align="center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                          @foreach ($type as $key=>$type)
                            <tr>
                                  <td>{{ $key+1 }}</td>
                                     <td>{{ $type->name }}</td>
                                     <td align="center"><a href="{{url('admin/case/edit_type',$type->id)}}"  class="label label-success tag">编辑</a>
                                                                              
                                      <a href="{{url('admin/case/deltype',$type->id)}}"  class="label label-warning tag del" style="background-color:red;">删除</a>

                                     </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>

                </ul>
            </div>
        </div>
    </div>

    <script type="text/javascript">
      function check() {
          $('#search_form').submit();
      }

      $('.del').click(function(){
          var i=window.confirm("确认删除该条数据？");
          if(i==0){
              return false;
          }
      });
      function load_city_data_from_menu($id){
          $('#dg').datagrid('load',{
              city: $id,
          });
          $("input[name='city']").val($id);
          $("input[name='area']").val('');
          $("input[name='org_id']").val('');
      }

      function load_area_data_from_menu($id){
          $('#dg').datagrid('load',{
              area: $id,
          });
          $("input[name='city']").val('');
          $("input[name='area']").val($id);
          $("input[name='org_id']").val('');
      }
      function load_org_data_from_menu($id){
          $('#dg').datagrid('load',{
              org_id: $id,
          });
          $("input[name='city']").val('');
          $("input[name='area']").val('');
          $("input[name='org_id']").val($id);
      }
  </script>
@stop
